package com.zrrd.gmall.mq.controller;

import com.zrrd.gmall.common.result.Result;
import com.zrrd.gmall.rabbit.service.RabbitService;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;

@RestController
@RequestMapping("/mq")
public class Mqcontroller {
    @Autowired
    private RabbitService rabbitService;
    @Autowired
    private RabbitTemplate rabbitTemplate;
    //消息发送测试
    @GetMapping("/sendConfirm")
    public Result sendConfirm(){
        rabbitService.senMessage("exchange.confirm",
                "routing.confirm","这是测试消息");
        return Result.ok();
    }
    //延迟插件延迟消息不管了 演示一下而已

}
